home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / MosaicSRC / libwww2 / HText.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  3.0 KB  |  122 lines

  1. /*                                 Rich Hypertext object for libWWW
  2.                   RICH HYPERTEXT OBJECT
  3.  
  4.  */
  5.  
  6. /*
  7.  
  8.    This is the C interface to the Objective-C (or whatever) HyperText class.
  9.  
  10.  */
  11. #ifndef HTEXT_H
  12. #define HTEXT_H
  13. #include "HTAnchor.h"
  14. #include "HTStream.h"
  15.  
  16. #ifdef SHORT_NAMES
  17. #define HTMainText            HTMaText
  18. #define HText_new            HTHTNew
  19. #define HText_free            HTHTFree
  20. #define HText_beginAppend        HTHTBeAp
  21. #define HText_endAppend         HTHTEnAp
  22. #define HText_appendCharacter        HTHTApCh
  23. #define HText_appendText        HTHTApTe
  24. #define HText_appendParagraph        HTHTApPa
  25. #define HText_beginAnchor        HTHTBeAn
  26. #define HText_endAnchor         HTHTEnAn
  27. #define HText_dump            HTHTDump
  28. #define HText_nodeAnchor        HTHTNoAn
  29. #define HText_select            HTHTSele
  30. #define HText_selectAnchor        HTHTSeAn
  31. #define HText_replaceSel        HTHTRepl
  32. #define HText_applyToSimilar        HTHTApTo
  33. #define HText_unlinkSelection        HTHTUnSe
  34. #define HText_linkSelTo         HTHTLiSe
  35. #define HText_referenceSelected     HTHTRefS
  36. #endif
  37.  
  38. #ifndef THINK_C
  39. #ifndef HyperText        /* Objective C version defined HyperText */
  40. typedef struct _HText HText;    /* Normal Library */
  41. #endif
  42. #else
  43. class CHyperText;        /* Mac Think-C browser hook */
  44. typedef CHyperText HText;
  45. #endif
  46.  
  47. extern HText * HTMainText;        /* Pointer to current main text */
  48.  
  49. /*            Creation and deletion
  50. **
  51. **    Create hypertext object                 HText_new
  52. */
  53.  extern HText * HText_new PARAMS((void));
  54.  
  55. /*    Free hypertext object                    HText_free
  56. */
  57. extern void    HText_free PARAMS((HText * me));
  58.  
  59.  
  60. /*            Object Building methods
  61. **            -----------------------
  62. **
  63. **    These are used by a parser to build the text in an object
  64. **    HText_beginAppend must be called, then any combination of other
  65. **    append calls, then HText_endAppend. This allows optimised
  66. **    handling using buffers and caches which are flushed at the end.
  67. */
  68. extern void HText_beginAppend PARAMS((HText * text));
  69.  
  70. extern void HText_endAppend PARAMS((HText * text));
  71. extern void HText_doAbort PARAMS((HText * text));
  72. extern void HText_clearOutForNewContents PARAMS((HText * text));
  73.  
  74. /*    Add one character
  75. */
  76. extern void HText_appendCharacter PARAMS((HText * text, char ch));
  77.  
  78. /*    Add a zero-terminated string
  79. */
  80. extern void HText_appendText PARAMS((HText * text, CONST char * str));
  81. /*    Add a block.
  82. */
  83. extern void HText_appendBlock PARAMS((HText * text, CONST char * str, int len));
  84.  
  85. /*    New Paragraph
  86. */
  87. extern void HText_appendParagraph PARAMS((HText * text));
  88.  
  89. /*    Start/end sensitive text
  90. **
  91. ** The anchor object is created and passed to HText_beginAnchor.
  92. ** The senstive text is added to the text object, and then HText_endAnchor
  93. ** is called. Anchors may not be nested.
  94. */
  95.  
  96. extern void HText_beginAnchor PARAMS((HText * text, char * anc));
  97. extern void HText_endAnchor PARAMS((HText * text));
  98.  
  99.  
  100. /*    Dump diagnostics to stderr
  101. */
  102. extern void HText_dump PARAMS((HText * me));
  103.  
  104. extern char *HText_getText (HText *me);
  105. extern int HText_getTextLength (HText *me);
  106. extern char **HText_getPtrToText (HText *me);
  107.  
  108. /*        Browsing functions
  109. **        ------------------
  110. */
  111.  
  112. /*    Bring to front and highlight it
  113. */
  114.  
  115. extern BOOL HText_select PARAMS((HText * text));
  116.  
  117.  
  118. #endif /* HTEXT_H */
  119. /*
  120.  
  121.    end    */
  122.